cmake_minimum_required(VERSION 3.21)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

project(dspNasm LANGUAGES C CXX)

if (PROJECT_BINARY_DIR STREQUAL PROJECT_SOURCE_DIR)
    message(WARNING "The binary directory of CMake cannot be the same as source directory!")
endif ()

if (NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE Release)
endif ()

link_directories(lib/antlr4/lib)

include_directories(lib/antlr4/include/antlr4-runtime antlr4/ include/)

file(GLOB_RECURSE srcs CONFIGURE_DEPENDS antlr4/*.cpp src/* main.cpp)

add_executable(nasm ${srcs})

add_subdirectory(lit)

target_link_libraries(nasm antlr4-runtime)
